<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java"
         pageEncoding="utf-8"
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的订单</title>
    <%--<link type="text/css" rel="stylesheet" href="../../static/css/common.css" >--%>
    <%@include file="/pages/common/head.jsp" %>
    <%--静态引用,包括项目起始点,和css,jquery等头部信息 --%>
    <c:if test="${empty sessionScope}">
        <script>
            location.href = "<%=basepath%>client/bookServlet?action=page&pageNo=" + 1;
        </script>
    </c:if>
    <style type="text/css">
        h1 {
            text-align: center;
            margin-top: 200px;
        }
    </style>
</head>
<body>

<div id="header">
    <img class="logo_img" alt="" src="<%=basepath%>static/img/logo.gif">
    <span class="wel_word">我的订单</span>
    <%--                <div>--%>
    <%--                    <span>欢迎<span class="um_span">韩总</span>光临尚硅谷书城</span>--%>
    <%--                    <a href="../order/order.jsp">我的订单</a>--%>
    <%--                    <a href="../../index_book.jsp">注销</a>&nbsp;&nbsp;--%>
    <%--                    <a href="../../index_book.jsp">返回</a>--%>
    <%--                </div>--%>
    <div>
        <c:if test="${not empty sessionScope}">
            <c:if test="${empty sessionScope.user}">
                <a href="<%=basepath%>pages/user/login.jsp">登录</a>
                <a href="<%=basepath%>pages/user/regist.jsp">注册</a> &nbsp;&nbsp;
            </c:if>
            <c:if test="${not empty sessionScope.user}">
                <span>欢迎<span class="um_span">${sessionScope.user.username}</span>光临尚硅谷书城</span>
                <a href="<%=basepath+"pages/order/order.jsp"%>">我的订单</a>
                <a href="<%=basepath+"userServlet?action=logout"%>">注销</a>&nbsp;&nbsp;
                <a href="<%=basepath+"index_book.jsp"%>">返回</a>
            </c:if>
        </c:if>
    </div>
</div>

<div id="main">

    <table>
        <tr>
            <td>日期</td>
            <td>金额</td>
            <td>状态</td>
            <td>详情</td>
        </tr>
        <c:if test="${not empty sessionScope}">
            <c:if test="${not empty sessionScope.orderList}">
                <c:forEach items="${sessionScope.orderList}" var="order">
                    <tr>
                        <td>${order.createTime}</td>
                        <td>${order.price}</td>
                        <c:if test="${order.status==0}">
                            <td>未发货</td>
                        </c:if>
                        <c:if test="${order.status==1}">
                            <td>已发货</td>
                        </c:if>
                        <c:if test="${order.status==2}">
                            <td>已签收</td>
                        </c:if>
                        <td><a href="<%=basepath%>orderServlet?action=showOrderDetail&orderId=${order.orderId}">查看详情</a></td>
                    </tr>
                </c:forEach>
            </c:if>
        </c:if>
        <c:if test="${empty sessionScope.user}">
            <tr>
                <td>未登录,不能查看订单信息</td>
            </tr>
        </c:if>
    </table>


</div>

<%--        <div id="bottom">--%>
<%--            <span>--%>
<%--                尚硅谷书城.Copyright &copy;2015--%>
<%--            </span>--%>
<%--        </div>--%>
<%@include file="/pages/common/foot.jsp" %>
<%--静态引用,公共底部--%>
</body>
</html>